package routers

import (
	"github.com/gin-gonic/gin"
	"shop-admin/controller"
	"shop-security/preAuthorize"
)

func privateNotice(router *gin.RouterGroup) {
	api := &controller.NoticeController{}
	notice := router.Group("/shop/notice")
	{
		notice.GET("/page", api.Page)                                                   //分页
		notice.GET("/info/:id", api.Info)                                               //通过id查询公告管理
		notice.POST("", preAuthorize.HasPermission("shop:notice:save"), api.Save)       //新增
		notice.PUT("", preAuthorize.HasPermission("shop:notice:update"), api.Update)    //更新
		notice.DELETE("", preAuthorize.HasPermission("shop:notice:delete"), api.Delete) //删除
	}
}
